<template>
	<view class="itemBox">
		<template v-if="!isOrder">
			<UserByList @userPage="$emit('userPage',item)" :item="item" :type="type"
				@communicates="$emit('communicates',item)"></UserByList>
		</template>
		<view class="toppingByList" v-if="item.is_topping == '2'">
			<u-icon name="arrow-upward"></u-icon>
		</view>
		<template>
			<view style="height: 30rpx;"></view>
			<view class="lineP">
				<view class="label">{{$t("曝光标题")}}:</view>
				<view class="text u-line-2">{{item[$t('item.title')] || $t("暂无信息")}}</view>
			</view>
			<view class="lineP">
				<view class="label ">{{ $t('曝光公司或个人名称') }}:</view>
				<view class="text u-line-3">{{item[$t('item.name')] || $t("暂无信息") }}</view>
			</view>
			<view class="lineP">
				<view class="label ">{{ $t('曝光内容') }}:</view>
				<view class="text u-line-3">{{item[$t('item.content')] || $t("暂无信息") }}</view>
			</view>
			<view class="lineP">
				<view class="label">{{ $t('所在城市') }}:</view>
				<!-- <view class="text">{{item.exposurecitys[$t('item.city.mergename')] || $t("暂无信息") }}</view> -->
				<view class="text">{{item.hyd || $t("暂无信息") }}</view>
			</view>
		</template>
		<slot name="list"></slot>
		<view class="bidding_address">
			<view class="bidding_ares">
				<view class="bidding_city">
					<img :src="HTTP_IMG_UTL+'location2.png'" class="headline_img" />
					<!-- <text class="text">{{item.exposurecitys[$t('item.city.mergename')] || $t("暂无信息") }}</text> -->
					<text class="text">{{item.hyd || $t("暂无信息") }}</text>
				</view>
				<view class="bidding_time">
					<text style="line-height: 50rpx;">{{ time("S", item.createtime) }}</text>
				</view>
			</view>
			<view class="bidding_btn" @click.stop="$emit('communicate',item)" v-if="!isOrder">
				<text class="btnStyle">
					{{ type == 1 ? $t('即时沟通') : $t(jb) }}
				</text>
			</view>
		</view>
		<slot name="btns"></slot>
	</view>
</template>

<script>
	import UserByList from '@/components/UserByList.vue'
	import {
		createC2CConversation,
		isBase64,
		time
	} from "@/common/public";
	import TransportType from '@/components/TransportType.vue'
	import FromToCountry from '@/components/FromToCountry.vue'
	import Tag from '@/components/Tag.vue'
	import {
		IMAGE_URL,
		HTTP_IMG_UTL
	} from "@/config/app";
	export default {
		components: {
			TransportType,
			FromToCountry,
			Tag,
			UserByList
		},
		props: {
			item: {
				type: Object,
				default: {},
			},
			type: {
				type: String | Number,
				default: '1',
			},
			isOrder: {
				type: [Boolean,Number],
				default: false,
			}
		},
		computed: {
			toImages() {
				return (src) => {
					return isBase64(src) ? src : (this.isOrder ? src.url : IMAGE_URL + src)
				}
			},
		},
		data() {
			return {
				HTTP_IMG_UTL,
				jb:'参与订单'
				
			};
		},
		methods: {
			time
		},
		mounted() {
			if(uni.getStorageSync('off')==false){
				this.jb = '参与订单'
			}else{
				this.jb = '参与竞标'
			}
		},
	}
</script>

<style lang="scss" scoped>
	.itemBox {
		box-shadow: 0 0 10px #ddd;
		background: #ddd;
		padding: 10px;
		border-radius: 20rpx;
		background: #fff;
		margin-bottom: 20rpx;
		position: relative;

		&.yellow {
			background: #fefcf6;
		}

		.lineP {
			display: flex;
			align-items: flex-start;
			margin-bottom: 8px;
			flex-direction: column;

			img {
				width: 35rpx;
				height: 35rpx;
			}

			.label {
				// margin: 0 20rpx;
				font-weight: 600;
				margin-bottom: 10rpx;
			}

			.text {
				// flex: 0 0 400rpx;
			}
		}

		.productImg {
			position: absolute;
			right: 24px;
			top: 220rpx;
			display: flex;
			flex-direction: column;
			align-content: center;
			align-items: center;

			img {
				width: 200rpx;
				height: 214rpx;
			}
		}

		//地址信息
		.bidding_address {
			padding: 13.6rpx $my-padding-20 10rpx $my-padding-20;
			margin-top: 30rpx;
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			font-size: $my-font-size21;
			font-weight: 400;
			color: #888888;
			line-height: 30rpx;

			.bidding_ares {
				flex: 1;
				display: flex;
				flex-direction: column;
				justify-content: flex-start;

				.bidding_city {
					display: flex;
					align-items: center;

					img {
						width: 30rpx;
						height: 30rpx;
						margin-right: 10rpx;
					}

					.text {
						width: 300rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}
				}

				.bidding_ares1 {
					display: flex;
					justify-content: flex-start;

					image {
						width: 24.42rpx;
						height: 31.4rpx;
					}
				}
			}
		}

		.bidding_betwn {
			display: flex;
			// justify-content: space-between;
			align-items: flex-end;

			.chat {
				transform: translateY(0rpx);
			}

			.userName {
				height: 50rpx;

				.bidding_user_text {
					display: block;
					padding-left: 0;
				}

				.country_icon {
					padding-left: 0;
				}
			}

			.flex {
				display: flex;
				justify-content: space-between;
				align-items: center;
			}


			.bidding_user {
				display: flex;
				flex-direction: row;
				align-items: center;
				// padding: $my-padding-20;
				margin-right: 10rpx;


				//头像大小
				.bidding_user_image {
					padding-left: $my-padding-10;
					height: 50rpx;
					width: 50rpx
				}

				//用户图标
				.bidding_user_icon {
					padding-left: $my-padding-10;
					height: 35rpx;
					width: 35rpx;
				}
			}
		}

		.title {
			color: #e43b14;
			font-size: 38rpx;
			border-bottom: 1rpx solid #cccccc;
			font-weight: 600;
			padding-bottom: 50rpx;
			margin-bottom: 10rpx;
			word-break: break-all;
			// padding-left: 28rpx;

			&.none-border-bottom {
				border-bottom: none;
			}
		}

		.type {
			display: flex;
			justify-content: space-between;
			align-items: flex-end;
			padding-left: 10rpx;
			padding-right: 22rpx;
			// width: 90%;
			// margin: 0 auto;
		}

		.address {
			margin-bottom: 32rpx;
			font-size: 30rpx;
			position: relative;
			padding-left: 45rpx;
			// font-weight: 600;

			// .warp {
			// 	width: 55%;
			// }

			.headline_img {
				position: absolute;
				left: 0;
				top: 4rpx;
				width: 30rpx;
				height: 30rpx;
			}

			.label {
				font-weight: 600;
				margin-bottom: 10rpx;
			}
		}
	}
</style>